import { Component, OnInit, ViewChild } from '@angular/core';
import { _HttpClient, ModalHelper } from '@delon/theme';
import { STColumn, STComponent } from '@delon/abc';
import { SFSchema } from '@delon/form';
import { ColumnType, SPage } from '@shared/components/table-page/table-page.component';
import { NzModalService } from 'ng-zorro-antd';
import { ApiService } from '@core/services/api';
import { Operator, Section } from '@core/config/dic.config';

@Component({
  selector: 'app-come-count-module',
  templateUrl: './come-count.component.html',
})
export class ComeCountModuleComponent implements OnInit {
  config: SPage = {
    columns: [
      /*{
        index: 'id',
        title: '多选',
        type: ColumnType.checkbox,
      },*/
      {
        index: 'isIp',
        title: '点位IP',
        filter: {
          placeholder: '请输入点位IP',
          type: 'string'
        }
      },
      {
        index: 'areaName',
        title: '所属村',
        /*filter: {
          placeholder: '请输入村庄',
          type: 'string'
        }*/
      },
      {
        index: 'houseAddress',
        title: '楼栋地址',
        filter: {
          placeholder: '请输入楼栋',
          type: 'string'
        }
      },
      {
        index: 'dhDoorName',
        title: '门名称',
        /*filter: {
          placeholder: '请输入门名称',
          type: 'string'
        }*/
      },
      {
        index: 'deviceCode',
        title: '主机串号',
        filter: {
          placeholder: '请输入主机串号',
          type: 'string'
        }
      },
      {
        index: 'sectionType',
        title: '标段',
        filter: {
          placeholder: '请选择标段',
          type: 'select',
          items: Section
        }
      },
      {
        index: 'isSupplierName',
        title: '所属运营商',
        filter: {
          placeholder: '请选择运营商',
          type: 'select',
          items: Operator
        }
      },
      {
        index: 'isPeopleNum',
        title: '实名人员数量',
        /*filter: {
          placeholder: '实名人员数量',
          type: 'string'
        }*/
      },
      {
        index: 'isInoutNum',
        title: '实际出入数量',
        /*filter: {
          placeholder: '实际出入数量',
          type: 'string'
        }*/
      },
      {
        index: 'isInoutPercentage',
        title: '出入百分比',
        filter: {
          placeholder: '出入百分比',
          type: 'string'
        }
      },
      {
        index: 'recordTime',
        title: '统计时间',
        filter: {
          placeholder: '统计时间',
          type: 'date',
          mode: 'day'
        }
      },
    ],
    showCheckBox: true,
    reqUrl: this.api.assess.inoutStatistic.url
  }

  constructor(private http: _HttpClient, private modal: NzModalService, private api: ApiService) { }

  ngOnInit() { }

  operate(e: any): void {
    console.log(e);
  }
  _console(e: any): void {
    console.log(e)
  }

}
